package com.example.demo;

import com.example.demo.service.DemoService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/*
 * 类描述:
 *【题目2】.使用sql+java代码统计2022-12-01至2022-12-09每天的商品的总和、平均值、最大值、最小值，按照商品入库日期排序，输出结果示例：
				[
					{
						tjrq:'2022-12-01',
						total:100,
						avg:30,
						min:10,
						max:120
					},
					{
						tjrq:'2022-12-02',
						total:100,
						avg:30,
						min:10,
						max:120
					},
					{
						tjrq:'2022-12-03',
						total:100,
						avg:30,
						min:10,
						max:120
					}
				]
 *
 * @Author: Administrator
 * @Date: 2023/2/23
 * @Version: 1.0.0
 */
@SpringBootTest
public class Exam2Testor {


    @Autowired
    private DemoService demoService;


    @Test
    void m2(){
        Map<String,String> param=new HashMap();
        param.put("startDate","2022-12-01");
        param.put("endDate","2022-12-09");

        try {
            List<LinkedHashMap<String,String>> resultD = demoService.examtest2(param);
            System.out.println(resultD);

        } catch (Exception e) {
            throw new RuntimeException(e);
        }



    }

}
